<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2019/4/30
  Time: 10:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="../common.jsp"%>
    <script type="application/javascript">
        $(function(){
            $("#menu").tree({
                url:ctx+"/home/getMenuList",
                method:"GET",
                onClick : function(node){

                    if(node.href!=null && node.href!=''){

                        addTab(node.text,node.href);
                    }
                }
            });
        });

    function addTab(title,url){

        if($("#maintabs").tabs('exists',title)){
            $("#maintabs").tabs("select",title);
        }else{
            var contentHtml= '<iframe scrolling="auto" frameborder="0" src="${ctx}/'+url+'" style="width:100%;height:100%;"></iframe>';
            $("#maintabs").tabs("add",{
                title:title,
                content:contentHtml,
                closable:true
            })
        }
    }
</script>

<html>
<head>
    <title>主页面</title>
</head>
<body class="easyui-layout">
<div data-options="region:'north',border:false" style="height:60px;background:#B3DFDA;padding:10px">
    <%@include file="../head.jsp"%>
</div>
<div data-options="region:'west',split:true,title:'West'"  style="width:150px;padding:10px;">

    <div id="menu"></div>
</div>
<div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;">
    <%@include file="../foot.jsp"%>
</div>
<div id="maintabs" class="easyui-tabs" data-options="region:'center',title:'Center'">
   <div id="content">

   </div>
</div>

</body>

</html>
